import { defineStore } from 'pinia'
import { AllVideo, Mv, MvData } from '@/models/mv'
import { getAllvideo, getCloudMusic, getMvDetail, getMvUrl } from '@/utils/api'

export const mv = defineStore('mv', {
    state: () => {
        return {
            mvDetail: {} as MvData,
            data: {} as Mv,
            allVedio: {} as AllVideo
        }
    },
    actions: {
        async getMvUrl(id: number | string) {
            /* 获取详情 */
            this.mvDetail = await getMvDetail(id)
            /* 获取地址 */
            this.data = await getMvUrl(id)
            /* 获取推荐 */
            this.allVedio = await getAllvideo(id)
        }
    },
    getters: {}
})

